package ua.com.stormlabs.tiny.licenseserver.utils;


import java.util.ArrayList;
import java.util.List;

/**
 * @author Maxim Bondarenko
 * @version 1.0 6/30/11
 */

public class BaseInputDataErrorsProvider implements InputDataErrorsProvider {

    private final List<String> errorsTexts;

    public BaseInputDataErrorsProvider() {
        errorsTexts = new ArrayList<String>();
    }

    @Override
    public void addError(String errorText) {
        ArgumentGuard.checkNotNull(errorText, "errorText");
        ArgumentGuard.checkNotBlank(errorText, "errorText");

        errorsTexts.add(errorText);
    }

    @Override
    public List<String> getAllErrors() {
        return errorsTexts;
    }
}
